#include "data_hub.h"
#include <qDebug>
#include<any>
#include "../common/collection_type.h"
#include "../common/factor_type.h"
#include "../common/contract_type.h"
#include "../common/strategy_type.h"
DataHub::DataHub(RpcClient* rpc_):rpc(rpc_)
{
}

DataHub::~DataHub()
{
	stopAndDelete();
}

bool DataHub::event(std::unique_ptr<Event> e)
{
	if (e->status == EventStatus::Done) {
		//qDebug() << "event done";
		auto d=std::any_cast<std::unordered_map<uint32_t, std::shared_ptr<Contract>>>(e->payload);
		std::cout << d.size() ;
		return true;
	}
	stamp(e.get());
	rpc->listTarget(e->type, std::move(e));


	return true;
}
